<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <div id="xdd">我的弟弟小萝卜头!!</div>
    <br>
    <button onclick="delDiv()">删除div</button>

    <script>
        function delDiv(){
            var xdd = document.getElementById("xdd");
            xdd.remove();
        }
    </script>
</body>
</html>